function r(e, t) {
    var n, a, i = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), r = [];
    if (t = t || i.length,
        e)
        for (n = 0; n < e; n++)
            r[n] = i[0 | Math.random() * t];
    else
        for (r[8] = r[13] = r[18] = r[23] = "-",
                 r[14] = "4",
                 n = 0; n < 36; n++)
            r[n] || (a = 0 | 16 * Math.random(),
                r[n] = i[19 == n ? 3 & a | 8 : a]);
    return r.join("")
}

function g() {
    return d = r(16, 61),
        d
}

console.log(g())